#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<string.h>
void MP(int arr[], int num)
{
	int i,j = 0;
	for (i = 0; i < num; i++)
	{
		int flag = 0;
		for (j = 0; j < num-1-i; j++)
		{
			if (arr[j] > arr[j + 1])
			{
				flag = 1;
				int tmp = 0;
				tmp = arr[j];
				arr[j] = arr[j + 1];
				arr[j + 1] = tmp;
			}
		}
		if (flag = 0)
			break;
	}

}
int main()
{
	int arr[10] = { 2,3,4,1,5,6,7,9,8 };
	int num = sizeof(arr) / sizeof(arr[0]);
	MP(arr, num);
	int n = 0;
	for (n = 0; n < num; n++)
	{
		printf("%d ", arr[n]);
	}
	return 0;
}